<?php include dirname(__FILE__).'/header.tpl.php'; ?>

<div id="ct" class="wp cl">
<script type="text/javascript" src="<?=STATIC_URL;?>js/artDialog/artDialog.js"></script>
<script type="text/javascript" src="<?=STATIC_URL;?>js/artDialog/artDialog.iframeTools.js"></script> 


<div class="mn">
<div>
<div class="bm_c">
<div class="box" id="promos_detail2"><!--详情页主体begin-->
        <!--
			* 如果是会员版本, 内容套在member元素中
		-->

                        <div class="box header2">
                     
                <h2><?=$coupon['title'];?></h2>
                <div class="smsPut">
                    <a class="smsDload" title="短信下载" onClick="d()">短信下载</a>

                    <a class="toPut" target="_blank" title="打印" href="<?=$coupon['coupon_id'];?>/print">
                    打印</a>
               </div>
            </div>
            
                        <div class="box section">
                <div id="promos_dticket" class="box">
                    <div id="promosSign" class="box uparea">
                        <div class="promosSign ps_dazhe"><!--减免--></div>
                        <div class="tarea">

                                                        <!--有图版begin-->
                                                        <img alt="" src="<?=STATIC_URL;?>upload/<?=$coupon['picture'];?>" width="600px" height="550px">
                                                        <!--有图版end-->

                            
                        </div>
                        <div class="tinfo">
                            <div class="cale">
                                <h5>有效期至</h5>
                                <div class="m"><?=substr($coupon['stop_date'],0,7);?></div>
                                <div class="d"><?=substr($coupon['stop_date'],8,2);?></div>
                            </div>
                            <ul class="times">
                                <li title="该优惠券总下载数"><em class="em"><?=$coupon['z_num'];?></em><p>本券累计下载</p></li>
                                <li title="最近7天下载数"><em><?=$coupon['w_num'];?></em><p>本周下载</p></li>
                                <li title="商家历史所有优惠券总下载数"><em><?=$coupon['z_num'];?></em><p>商家累计下载</p></li>
                                <li title="商家累计发布优惠券数" class="end"><em>1</em><p>累计优惠券</p></li>
                            </ul>
                        </div>
                    </div>
<div class="box downarea">
                        <div class="weixin">
                                                    </div>
      <div class="rb"></div>
                    </div>
                </div><!--end of #promos_dticket-->

                <div class="box footer">
                    <div class="syncbox">
                        <span class="re">分享到：</span>
                        <a class="sync1" target="_blank" href="http://v.t.qq.com/share/share.php?title=%23QQ%E7%BE%8E%E9%A3%9F%E4%BC%98%E6%83%A0%E5%88%B8%23%E5%A4%A7%E8%BF%9E%E6%96%87%E5%9B%AD%E5%A4%A7%E9%85%92%E5%BA%97_%E8%A5%BF%E9%A4%90%EF%BC%8C%E8%B6%85%E5%80%BC%E8%87%AA%E5%8A%A98.5%E6%8A%98%E4%BC%98%E6%83%A0%EF%BC%81%E9%B2%8D%E9%B1%BC%E6%8D%9E%E9%A5%AD%E3%80%81%E8%9B%8B%E9%BB%84%E7%84%97%E5%8D%97%E7%93%9C%EF%BC%8C%E5%80%BC%E5%BE%97%E4%B8%80%E5%B0%9D%7E%EF%BC%81&amp;pic=http%3A%2F%2Fqqfood.tc.qq.com%2Fmeishio%2F16%2F5f980487-c9f6-4a66-94e6-a1659c72ab89%2F0&amp;url=http%3A%2F%2Fmeishi.qq.com%2Fcoupons%2F14086361152174905798-view29128&amp;source=meishi" title="腾讯微博" onClick="pgvSendClick({hottag:'MEISHI.COUPON_VIEW.SHARE.14086361152174905798'});"><span>&nbsp;</span>腾讯微博</a><a class="sync2" title="QQ空间" onClick="pgvSendClick({hottag:'MEISHI.COUPON_VIEW.SHARE.14086361152174905798'});" target="_blank" href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=http%3A%2F%2Fmeishi.qq.com%2Fcoupons%2F14086361152174905798-view29128?us=sqzone"><span>&nbsp;</span>QQ空间</a><a class="sync3" title="QQ好友" style="position: relative; top: 0px; left: 0px;"><span>&nbsp;</span>QQ好友<div id="copytoQQSWFContainer" style="width: 63px; height: 23px; position: absolute; top: 0px; left: 0px;">
                            <object data="/misc/scripts/copytoclip.swf" name="copytoQQclip" id="copytoQQclip" type="application/x-shockwave-flash" height="23" width="63"><param value="false" name="menu"><param value="noScale" name="scale"><param value="false" name="allowFullscreen"><param value="always" name="allowScriptAccess"><param value="transparent" name="wmode"><param value="str=大连文园大酒店_西餐，超值自助8.5折优惠！鲍鱼捞饭、蛋黄焗南瓜值得一尝~！http%3A%2F%2Fmeishi.qq.com%2Fcoupons%2F14086361152174905798-view29128" name="flashvars"></object><address id="copyQQAddr" style="display: none;">大连文园大酒店_西餐，超值自助8.5折优惠！鲍鱼捞饭、蛋黄焗南瓜值得一尝~！http%3A%2F%2Fmeishi.qq.com%2Fcoupons%2F14086361152174905798-view29128</address>
                            </div></a>
                    </div>

                </div>

                <div id="promos_desc">

                                        <h3>本券优惠详情</h3>
                    <div class="dbox">
                        <ul class="items">
                                                  <?=$coupon['content'];?>  
                                                    </ul>
                                            </div>
                    
                    
                    
                                        <div class="box header2">
                        <div class="smsPut">
                             <a class="smsDload" title="短信下载" onClick="d2()">短信下载</a>

                            <a class="toPut" target="_blank" title="打印" href="<?=$coupon['coupon_id'];?>/print">
                            打印</a>
                        </div>
                    </div>
                    
                    <span class="note">
                    &nbsp;</span>

                </div><!--end of #promos_desc-->

            </div><!--end of .section-->
                    </div>



<div class="clear"></div>
</div>
</div>
</div>



  <div class="sd">
    <div class="bm sdc">
      <div class="bm_c">
        <h2>
          <?=h($shop['name']);?>
        </h2>
        <div class="feed_num cl">
          <ul>
            <li><a class="num" href="#">
              <?=$dish_count;?>
              </a></li>
            <li><a href="#">菜品</a></li>
          </ul>
          <ul style="border-left:1px dotted #ccc;border-right:1px dotted #ccc;">
            <li><a class="num" href="#">
              <?=$shop['likes'];?>
              </a></li>
            <li><a href="#">关注</a></li>
          </ul>
          <ul>
            <li><a class="num" href="#" id="views">
              <?=$shop['views'];?>
              </a></li>
            <li><a href="#">浏览</a></li>
          </ul>
        </div>
        <div id="call_number">
          <?php if($shop['call_number']){ ?>
          <div><b>订餐电话</b><br />
            400 0411 569 转
            <?=i($shop['call_number']);?>
          </div>
          <?php }else{ ?>
          <div><b>订餐电话</b><br />
            <?=str_replace('/', '<br />', $shop['telphone']);?>
          </div>
          <!--a class="get_number" href="/shop/<?=$shop['shop_id'];?>?code=<?=auth_string($shop['shop_id'], 'ENCODE');?>">查看订餐电话</a-->
          <?php } ?>
        </div>
        <p style="color:#d00" onclick="$('#moreinfo').toggle()">* 本店支持电话订餐、餐到付款</p>
      </div>
      <div class="bm_c">
        <ul id="moreinfo">
          <li>
            <label>送餐时间：</label>
            <span>
            <?=h($shop['delivery_time']);?>
            </span> </li>
          <li>
            <label>送餐范围：</label>
            <span>
            <?=h($shop['delivery_desc']);?>
            </span> </li>
          <li></li>
          <li>
            <label>区 域：</label>
            <span> <a href="/waimai/<?=h($bigzone->pinyin);?>">
            <?=h($bigzone->name);?>
            </a> / <a href="/waimai/<?=h($subzone->pinyin);?>">
            <?=h($subzone->name);?>
            </a></span> </li>
          <li>
            <label>地 址：</label>
            <span>
            <?=h($shop['address']);?>
            </span> </li>
        </ul>
      </div>
      <!--
      <div class="bm_h">
        <h2>我的订单</h2>
      </div>
      <div class="bm_c">
        <div id="mycart" style="padding:5px 0;height:100px">

            <center>暂无订单，单击左边菜品下单</center>

        </div>
      </div>
-->
      <div class="bm_h">
        <h2>地图</h2>
      </div>
      <div class="bm_c">
        <div id="baidu_map" style="width: 208; height: 208px;"></div>
      </div>
      <div class="bm_h">
        <h2>微博</h2>
      </div>
      <div class="bm_c">
        <iframe width="100%" height="550" class="share_self" frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=550&fansRow=2&ptype=1&speed=0&skin=5&isTitle=0&noborder=0&isWeibo=1&isFans=1&uid=2607714464&verifier=fe5f84f0&dpc=1"></iframe>
      </div>
      <!---->
    </div>
  </div>
</div>
<div id="ol_contact"> <a class="online_se" onclick="openWin()" href="#">在线客服</a> </div>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>
<script type="text/javascript" src="<?=STATIC_URL;?>js/jquery-1.7.1.min.js"></script>
<!--script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script-->

<script type="text/javascript">
    function d(){
    art.dialog({title:'请先登录', width:'374px',height:'250px', content:"<iframe align='right' src='http://www.sudingke.xxx/login_iframe_2.html' width:'100%' height:'100%' />"});
    return false;
   };       
     function d2(){
    art.dialog({title:'请输入电话号码', width:'374px',height:'250px', content:"<iframe align='right' src='http://www.sudingke.xxx/info_tel.html' width:'100%' height:'100%' />"});
    return false;
   };            
 </script>
<script type="text/javascript">
function openWin(){
    window.open('http://chat.53kf.com/company.php?arg=sudingke&style=1', 'kf53', 'height=450,width=510,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');
}
function initMap(lng, lat){
    var level = 16;

    if(!lng || !lat || lng == "0" || lat == "0"){
        lng = 121.623517;
        lat = 38.911717;
        level = 13;
    }

    var map = new BMap.Map("baidu_map");//在百度地图容器中创建一个地图
    var point = new BMap.Point(lng, lat);//定义一个中心点坐标

    map.enableDragging();//启用地图拖拽事件，默认启用(可不写)
    map.disableScrollWheelZoom();//启用地图滚轮放大缩小(可不写)
    map.enableDoubleClickZoom();//启用鼠标双击放大，默认启用(可不写)
    map.disableKeyboard();//禁用键盘上下左右键移动地图，默认禁用(可不写)

    map.centerAndZoom(point, level);
    map.panTo(point);

    //var iconimg = "http://api.map.baidu.com/library/MarkerTool/1.2/src/images/us_mk_icon.png";
    var iconimg = "<?=STATIC_URL;?>img/common/map_flag.gif";
    var icon = new BMap.Icon(iconimg, new BMap.Size(40, 43));

    //覆盖层
    var marker = new BMap.Marker(point);
    marker.setIcon(icon);

    map.addOverlay(marker);
}

function addCart(dishId){
    $.get("/shop/<?=h($shop['shop_id']);?>/ajax/dish-" +dishId,
        function(data){
            if(data.success){
                if($("#cart_" +data.dish_id).get(0)){
                    var num = $("#cart_" +data.dish_id).find("select").get(0);
                    if(num.selectedIndex < 9)
                        num.selectedIndex += 1;
                }else{
                    appendCart(data.dish_id, data.name, data.price);
                }
                totalPrice();
            }
        }, 'json'
    );

    function appendCart(dishId, dishName, dishPrice){
        var html = '';
        html += '<tr id="cart_' +dishId+ '">';
        html += '<td class="ttl">' +dishName+ '</td>';
        html += '<td width="40">';
        html += '<select class="cart_o_num" name="itemNum[' +dishId+ ']" onChange="totalPrice()">';
        for(var i=1; i<=10; i++){
            html += '<option value="' +i+ '">' +i+ '</option>';
        }
        html += '</select>';
        html += '</td>';
        html += '<td width="30" class="price">' +dishPrice+ '</td>';
        html += '<td width="30"><a href="javascript:delCart(' +dishId+ ');" class="del_btn">删除</a></td>';
        html += '</tr>';

        $("#cartForm").show();
        $("#cartTable").append(html);
        $("#noItemTips").hide();
    }
}

function delCart(dishId){
    $("#cart_"+dishId).remove();
    if($("#cartTable").find("tr").size() == 0){
        $("#noItemTips").show();
    }
    totalPrice();
}

function totalPrice(){
    var oItem = $("#cartTable").find("tr");
    var cnt   = oItem.size();
    var total = 0;
    oItem.each(function(){
        total += parseInt($(this).find("select").val(), 10) * parseFloat($(this).find(".price").html(), 10);
    });

    $("#cartPrice").html(total);
    $("#sumPrice").val(total);
}

function toggleCart(){
    $("#cartForm").toggle();
}

$(document).ready(function() {

    $(".get_number").click(function(e){
        e.preventDefault();
        var code = $(this).attr("href").split("?code=")[1];
        $.get('/tools/getWaimaiTel?code=' + code,
            function(result){
                $("#call_number").html("<div><b>订餐电话</b><br />" + result.replace(regex = new RegExp('/', 'g'), '<br />') + "</div>");
            }
        );
        return false;
    });

    $(".menu").find("li").mouseover(function(){
        $(this).addClass("hover");
    }).mouseout(function(){
        $(this).removeClass("hover");
    });

    if($(".menu_foto").get(0)){ //照片模式
        var $menu = $(".menu_foto").find(".menu");
        //$menu.hide();
        //$($menu.get(0)).show();

        var $catelink = $("ul.category").find("a");
        $($catelink.get(0)).addClass("current");

        $catelink.click(function(){
            $catelink.removeClass("current");
            $(this).addClass("current");

            var idx = $(this).attr("ref");
            if(idx == 'all'){
                $menu.show();
            }else{
                $menu.hide();
                $($menu.get(idx)).show();
            }
        });
    }

    //地图
    initMap("<?=doubleval($shop['longitude']);?>", "<?=doubleval($shop['latitude']);?>");
});

</script>
<!--浏览器数器-->
<script type="text/javascript" src="/tools/count?shop_id=<?=i($shop['shop_id']);?>&id=views" charset="utf-8"></script>
<?php include dirname(__FILE__).'/footer.tpl.php'; ?>
